#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <string.h>

int n = 0;

void * f(void* a)
{
    for (int i=0;i<500000;i++)
    {
        n++;
    }
}

int main()
{
    pthread_t t1,t2;

    pthread_create(&t1,NULL,f,NULL);
    pthread_create(&t2,NULL,f,NULL);

    void* p1;
    void * p2;
    pthread_join(t1,&p1);
    pthread_join(t1,&p2);

    printf("%d\n",n);

}